Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Displaying Rendered • View rawDownload


docs/agents/skills/contribution-registries/SKILL.md dev (af76f09d) Text, 4.31 KB

Skill: contribution-registries

Wire nav, tools, commands, settings search, and WebSocket events through registries instead of hardcoding shell or App.vue dispatch.

When to use

• Adding a discoverable page, tool, command palette entry, or settings section
• Adding a new WebSocket event type handled by the UI
• Plugin contribution points or slot UI
• Adding or changing a sidebar nav badge (unread counts)

Registries

┌───────────────────────────────────────┬───────────────────────────────────────┐
│ Registry │ Role │
├───────────────────────────────────────┼───────────────────────────────────────┤
│ T383838navRegistry.js │ Primary sidebar / nav │
│ T383838toolsRegistry.js │ Tools area entries │
│ T383838commandRegistry.js │ Command palette │
│ T383838settingsSectionRegistry.js │ Settings search / sections │
│ T383838wsEventRegistry.js + T383838wsEventBridge.js │ Typed WS handlers │
│ T383838postInstallPromptRegistry.js │ Existing-user / after-install prompts │
└───────────────────────────────────────┴───────────────────────────────────────┘

Core boot registers once via T383838registerCoreContributions.js and T383838core*Entries.js siblings.

Nav badges

Sidebar pills are declared on T383838CORE_NAV_ENTRIES in T383838coreNavEntries.js via T383838badge: { source, pill, cap }.

Current sources:

┌──────────────────────────┬────────────────────────────────┬──────────────────────────────────────┐
│ Source │ Meaning │ Cleared when │
├──────────────────────────┼────────────────────────────────┼──────────────────────────────────────┤
│ T383838unreadConversationsCount │ Unread LXMF conversations │ Conversation marked read │
│ T383838relayChatUnreadCount │ RRC mention count (when relay… │ Mentions consumed on Relay chat page │
│ T383838missedCallsCount │ Unviewed T383838telephone_missed_cal… │ Call page opened or history cleared │
└──────────────────────────┴────────────────────────────────┴──────────────────────────────────────┘

T383838App.vue maps each source through T383838GlobalState and T383838getNavBadgeCount. Collapsed sidebar still shows pill badges on the icon. There is no header notification bell anymore. Message sounds stay under Settings.

For a new badge:

1. Add a T383838GlobalState counter
2. Add a T383838NavBadgeSource value and T383838badge on the nav entry
3. Wire T383838getNavBadgeCount in T383838App.vue
4. Refresh the count from the right API or WebSocket event
5. Clear it when the user has actually seen the related UI

Post-install / existing-user prompts

Use T383838postInstallPromptRegistry + T383838PostInstallPromptHost when you need to ask existing installs to do or acknowledge something after an upgrade.

1. Add an entry to T383838corePostInstallPromptEntries.js with a stable T383838id, T383838revision, and i18n T383838titleKey (optional description and button keys).
2. Register happens via T383838registerCoreContributions.
3. T383838App.vue shows the next pending prompt after tutorial / Android storage upgrade and before changelog.
4. To show the same prompt again later, bump T383838revision. Users who dismissed an older revision are prompted again.
5. Optional T383838shouldShow() gates platform or feature conditions. Optional T383838onPrimary / T383838onSecondary run actions before dismiss.

Seen revisions live in T383838localStorage under T383838meshchatx.post_install_prompts_seen via T383838postInstallPromptState.js.

Hard rules

• New top-level pages still need a route in T383838main.js (see T383838page-toast-tests). Registries cover discoverability and dispatch, not routing alone.
• Prefer T383838onWsEvent / registry handlers over growing ad-hoc T383838switch (json.type) blocks in T383838App.vue.
• Settings search keywords belong in the settings section registry, not scattered only inside T383838SettingsPage.vue.
• Plugin UI uses the existing slot vocabulary (T383838PluginSlotNode / related renderers). Do not invent a parallel slot system.

Key files

• T383838meshchatx/src/frontend/js/registries/
• T383838meshchatx/src/frontend/js/registries/registerCoreContributions.js
• T383838meshchatx/src/frontend/js/registries/coreNavEntries.js
• T383838meshchatx/src/frontend/js/GlobalState.js
• T383838meshchatx/src/frontend/components/plugins/PluginSlotNode.vue
• T383838meshchatx/src/frontend/main.js (routes)

Verification

T282828
pnpm Tffa657exec vitest run tests/frontend/ -t registry


If no dedicated registry tests match, run the page or App tests that cover the new entry, plus eslint on touched files.


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────